package com.feiyuan.movie.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.feiyuan.movie.entity.MovieJiListEntity;
import com.feiyuan.movie.service.MovieJiListService;
import com.feiyuan.common.utils.PageUtils;
import com.feiyuan.common.utils.R;



/**
 * 
 *
 * @author Xupf
 * @email xupengfei131276@126.com
 * @date 2024-10-24 16:53:28
 */
@RestController
@RequestMapping("movie/moviejilist")
public class MovieJiListController {
    @Autowired
    private MovieJiListService movieJiListService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("movie:moviejilist:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = movieJiListService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("movie:moviejilist:info")
    public R info(@PathVariable("id") Long id){
		MovieJiListEntity movieJiList = movieJiListService.getById(id);

        return R.ok().put("movieJiList", movieJiList);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("movie:moviejilist:save")
    public R save(@RequestBody MovieJiListEntity movieJiList){
		movieJiListService.save(movieJiList);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("movie:moviejilist:update")
    public R update(@RequestBody MovieJiListEntity movieJiList){
		movieJiListService.updateById(movieJiList);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("movie:moviejilist:delete")
    public R delete(@RequestBody Long[] ids){
		movieJiListService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
